#include <iostream>
using namespace std;

template <class Type> Type Max(const Type &a, const Type &b) {
    if (a < b)
        return b;
    else
        return a;
}

template <class Type> Type Min(const Type &a, const Type &b) {
    if (a < b)
        return a;
    else
        return b;
}

int main() {
    double x = 5.38, y = 6.09;
    cout << Max(x, y) << " " << Max<int>(x, y) << " ";
    cout << Min(x, y) << " " << Min<int>(x, y) << endl;

    return 0;
}
